<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 200px;
            background-color: rgb(172, 90, 90);
        }
        .box1{
            width: 100px;
            height: 100px;
            background-color: rgb(90, 150, 41);
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="box1"></div>
    </div>
    <script>
        // getBoundingClientRect()  获取该盒子的坐标信息.它和父元素没有任何位置关系,它是获取自己里离浏览器的位置 .
        console.log(document.querySelector('.box1').getBoundingClientRect());
    </script>
</body>
</html>